<?php

session_start();
require_once($_SERVER['DOCUMENT_ROOT']."/apps/class/transaction.php");

$action = 'LOGI';
$username = 'zerosottozero@gmail.com';
$userpass = 'sardegna';

try{
  $user = new user();
  if($action == 'SIGN'){
    $user->create_user_in_db($username,$userpass);
    $_SESSION['user'] = $user->get_user_id();
  }
  if($action == 'LOGI'){
    $user->login_user($username,$userpass);
    $_SESSION['user'] = $user->get_user_id();
  }
} catch (appException $e){
  echo $e->getMessage();  
} catch (Exception $e){
  echo $e->getMessage();
}

//try{
//  $user = new user('zerosottozero@gmail.com');
//}catch (appException $e){
//  $argument = $e->get_arguments();
//  user::create_user_in_db($argument[0]);
//}


?>